//=============================================================================
// TFHGunProj.
//=============================================================================
class TFHGunProj extends TFProjectile;

simulated function PostBeginPlay()
{
    Velocity = Vector(Rotation) * (Speed+(frand()*speed));
    if (PhysicsVolume.bWaterVolume)
        Velocity *= 0.9;

    Super.PostBeginPlay();
}

simulated function ProcessTouch (Actor Other, vector HitLocation)
{
    local float d;


    if ( (TFHGunProj(Other) == None) && ((Physics == PHYS_Falling) || (Other != Instigator)) )
    {
        d=damage;

        if(pawn(other)==none) d/=4;

        if ( Role == ROLE_Authority )
            Other.TakeDamage( d, Instigator, HitLocation,
            (MomentumTransfer * Velocity/speed), MyDamageType );

        Destroy();
    }
}

simulated function Landed( Vector HitNormal )
{
    SetPhysics(PHYS_None);
    Destroy();
}

simulated function HitWall( vector HitNormal, actor Wall )
{
    if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
    {
        if ( Level.NetMode != NM_Client )
        {
            Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), MyDamageType);
        }
   }
    Spawn(class'TaskForces.TFHGunExp',,,,rotator(hitnormal));
    if(frand()<0.75) Spawn(class'TaskForces.TFHGImpactSmoke',,,,rotator(hitnormal));
    Destroy();
}

simulated function PhysicsVolumeChange( PhysicsVolume Volume )
{
    if (Volume.bWaterVolume)
    {
        Velocity *= 0.9;
    }
}

defaultproperties
{
     Speed=5500.000000
     MaxSpeed=8000.000000
     Damage=5.000000
     MomentumTransfer=9000.000000
     MyDamageType=Class'taskforces.DamTypeHGun'
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'TFMedia.fX.tfBullet'
     LifeSpan=10.000000
     DrawScale=1.750000
     DrawScale3D=(Y=0.750000,Z=0.750000)
     PrePivot=(X=-30.000000)
     AmbientGlow=255
     Style=STY_Additive
     bFixedRotationDir=True
     RotationRate=(Roll=150000)
}
